package com.huawei.appmarket.service.settings.view.widget;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;
import android.widget.RadioButton;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse$LevelBean;
import o.azb;
import o.der.b;
import o.der.g;

public class GradeItemView extends LinearLayout {
    private d ʻ;
    private RelativeLayout ʼ;
    private RadioButton ʽ;
    private TextView ˊ;
    private View ˋ;
    private ImageView ˎ;
    private ImageView ˏ;
    private TextView ॱ;
    private View ॱˊ;
    private LinearLayout ॱॱ;
    private ImageView ᐝ;

    public interface d {
        void ॱ(GeneralResponse$LevelBean generalResponse$LevelBean);
    }

    public GradeItemView(Context context) {
        super(context);
        ˊ(context);
    }

    public GradeItemView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        ˊ(context);
    }

    public GradeItemView(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        ˊ(context);
    }

    private void ˊ(Context context) {
        LayoutInflater.from(context).inflate(g.ˎˎ, this, true);
        azb.ˏ(this);
        this.ॱ = (TextView) findViewById(o.der.d.ʿᐝ);
        this.ˊ = (TextView) findViewById(o.der.d.ʿˋ);
        this.ᐝ = (ImageView) findViewById(o.der.d.ߴ);
        this.ॱॱ = (LinearLayout) findViewById(o.der.d.ॱᐧ);
        this.ʼ = (RelativeLayout) findViewById(o.der.d.ॱʻ);
        this.ॱˊ = findViewById(o.der.d.ˋॱ);
        ((LayoutParams) this.ॱˊ.getLayoutParams()).setMarginStart(getContext().getResources().getDimensionPixelSize(b.ˏ) + getContext().getResources().getDimensionPixelSize(b.ॱˋ));
        if (this.ॱॱ != null) {
            if (TextUtils.isEmpty(this.ˊ.getText().toString())) {
                this.ॱॱ.setMinimumHeight(context.getResources().getDimensionPixelSize(b.ॱ));
                this.ʼ.setMinimumHeight(context.getResources().getDimensionPixelSize(b.ॱ));
            } else {
                this.ॱॱ.setMinimumHeight(context.getResources().getDimensionPixelSize(b.ˎ));
                this.ʼ.setMinimumHeight(context.getResources().getDimensionPixelSize(b.ˎ));
            }
        }
        this.ʽ = (RadioButton) findViewById(o.der.d.ﾟॱ);
        setOnClickListener(new OnClickListener(this) {
            final /* synthetic */ GradeItemView ˋ;

            {
                this.ˋ = r1;
            }

            public void onClick(View view) {
                if (this.ˋ.ʻ != null) {
                    this.ˋ.ʻ.ॱ((GeneralResponse$LevelBean) this.ˋ.getTag());
                }
            }
        });
    }

    public TextView ˋ() {
        return this.ॱ;
    }

    public void setTitle(TextView textView) {
        this.ॱ = textView;
    }

    public View ˏ() {
        return this.ॱˊ;
    }

    public void setDivider(View view) {
        this.ॱˊ = view;
    }

    public void setSubTitle(String str) {
        if (this.ˊ == null) {
            return;
        }
        if (TextUtils.isEmpty(str)) {
            this.ॱॱ.setMinimumHeight(getContext().getResources().getDimensionPixelSize(b.ॱ));
            this.ʼ.setMinimumHeight(getContext().getResources().getDimensionPixelSize(b.ॱ));
            this.ˊ.setVisibility(8);
            return;
        }
        this.ॱॱ.setMinimumHeight(getContext().getResources().getDimensionPixelSize(b.ˎ));
        this.ʼ.setMinimumHeight(getContext().getResources().getDimensionPixelSize(b.ˎ));
        this.ˊ.setText(str);
        this.ˊ.setVisibility(0);
    }

    public void setSubTitleLine(ImageView imageView) {
        this.ˏ = imageView;
    }

    public void setSpaceRootLayout(View view) {
        this.ˋ = view;
    }

    public void setSpaceLine(ImageView imageView) {
        this.ˎ = imageView;
    }

    public void setListener(d dVar) {
        this.ʻ = dVar;
    }

    public ImageView ˎ() {
        return this.ᐝ;
    }

    public void setGradeIcon(ImageView imageView) {
        this.ᐝ = imageView;
    }

    public void setChecked(boolean z) {
        this.ʽ.setChecked(z);
    }
}
